Media Gateway
How to obtain a public URL for NFL All Day media.
The endpoint can be accessed at:
https://media.nflallday.com/editions/${editionFlowId}/media/${mediaType}
editionFlowId
editionFlowId
is the flowId
for the edition you are trying to access. The following cadence script can be used to obtain a moments editionFlowId
:
import NonFungibleToken from 0xNONFUNGIBLETOKENADDRESS
import AllDay from 0xALLDAYADDRESS
pub fun main(address: Address, id: UInt64): UInt64? {
let account = getAccount(address)
let collectionRef = account.getCapability(AllDay.CollectionPublicPath)
.borrow<&{AllDay.MomentNFTCollectionPublic}>()
?? panic("Could not borrow capability from public collection")
let nft = collectionRef.borrowMomentNFT(id: id)
?? panic("Couldn't borrow momentNFT")
return nft.editionID
}
mediaType
mediaType
can be selected from the following list:
video
- main video that is seen on the moment page 1080x1080 https://media.nflallday.com/editions/353/media/videovideo-idle
- moment container animations without the actual moment 1080x1080 https://media.nflallday.com/editions/353/media/video-idleimage
- first frame from the moment 2880x2880 https://media.nflallday.com/editions/353/media/imageimage-scores
- image that shows the score from the game 2880x2880 https://media.nflallday.com/editions/353/media/image-scoresimage-details
- image that shows the player’s number and position **2880x2880** https://media.nflallday.com/editions/353/media/image-detailsimage-legal
- back of the moment, which shows the copyright information 2880x2880 https://media.nflallday.com/editions/353/media/image-legalimage-player
- picture of the player *2880x2880* https://media.nflallday.com/editions/353/media/image-playerimage-logo
- same asimage-player
but with the NFLAD logo **2880x2880** https://media.nflallday.com/editions/353/media/image-logo
Resize Params
The media gateway also supports resizing images by adding query params. You may add as many or as few as you like to suit your needs.
`?format=${format}&quality=${quality}&width=${width}&height=${height}`
The videos cannot be resized.
format
the format
of the image can be changed to suit your needs as seen in the cloudflare documentation. We recommend using webp
https://developers.cloudflare.com/images/image-resizing/resize-with-workers/#format
https://media.nflallday.com/editions/353/media/image?format=webp
quality
specifies the quality of the image, for a high quality images we recommend 90
, for a lower quality image you can go with 50
https://developers.cloudflare.com/images/image-resizing/resize-with-workers/#quality
https://media.nflallday.com/editions/353/media/image?quality=90
width
the maximum width of the image
https://developers.cloudflare.com/images/image-resizing/resize-with-workers/#width
https://media.nflallday.com/editions/353/media/image?width=500
height
the maximum height of the image
https://developers.cloudflare.com/images/image-resizing/resize-with-workers/#height
https://media.nflallday.com/editions/353/media/image?height=500